package com.lsh.util;

public class TokenUtil {

    /**
     * 生成登录token
     * @param name
     * @return
     */
    public static String buildToken(String name){
        return MD5Util.Md5Encode(buildName(name) + buildTime(), "UTF-8");
    }

    private static String buildName(String name){
        return MD5Util.Md5Encode(name, "UTF-8");
    }

    private static String buildTime(){
        String currentTimeMills = String.valueOf(System.currentTimeMillis());
        return MD5Util.Md5Encode(currentTimeMills, "UTF-8");
    }

}
